#ifndef KINECTKEYFRAMEDIALOG_H
#define KINECTKEYFRAMEDIALOG_H

#ifdef KINECT

#include <QDialog>
#include <QImage>

#include "GUI/Troy/troyframe.h"
#include "GUI/kinect/kinectdialog.h"

namespace Ui {
    class KinectKeyFrameDialog;
}

/**
  * @brief captures a single keyframe of data from the Kinect to insert into the current action.
  */
class KinectKeyFrameDialog : public KinectDialog {
private:
    Q_OBJECT
    Ui::KinectKeyFrameDialog *ui;
    QSharedPointer<TroyPose> _pose;
public:
    explicit KinectKeyFrameDialog(kinect::Kinect* kinect, QWidget *parent = 0);
    ~KinectKeyFrameDialog();
#ifdef WIIMOTE
    // Associates a wiimote for control
    void associateWiimote(WiimoteStatusDialog *dialog);
#endif
    /**
      * @brief Gets the keyframe captured by this dialog. This is not valid until the dialog has been accepted.
      * If the dialog is closed by a reject instead of an accept, then who knows what keyframe this will have.
      */
    //MotionKeyFrame getKeyFrame();
    QSharedPointer<TroyPose> getRecordedPose() const;

private slots:
    /**
      * @brief Saves the current position and displays it for the user to verify it is indeed what they want.
      */
    void takeSnapshot();
    void updateImage(QImage* image);
    //void kinectKeyFrame(MotionKeyFrame keyFrame);
    void receiveTroyPose(QSharedPointer<TroyPose> pose);
};

#endif // KINECT

#endif // KINECTKEYFRAMEDIALOG_H
